package cn.zwxky.android.user.Search;

import android.content.Context;
import android.view.View;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

import cn.zwxky.android.user.R;

/**
 * Created by Administrator on 2017/3/27 0027.
 */

public class SearchAdapter extends CommonRecycAdapter<SearchBean.ListBean> {
    public SearchAdapter(Context context, List<SearchBean.ListBean> list, int layoutId) {
        super(context, list, layoutId);
    }

    @Override
    public void convert(ViewHolderRecyc holder, final SearchBean.ListBean model) {
        holder.setText(R.id.item_search_text_name,model.getTitle());
        holder.setText(R.id.item_search_text_ren,"负责人："+model.getName());

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SearchClickEvent even = new SearchClickEvent();
                even.setData(model.getId());
                LsfbEvent.getInstantiation().post(even);
            }
        });
    }
}
